home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_073 / dterm / dterm.doc < prev    next >
Text File  |  1992-05-06  |  27KB  |  833 lines

  1. Article 3972 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!oddjob!mimsy!seismo!rutgers!mit-eddie!genrad!decvax!ucbvax!CORY.BERKELEY.EDU!dillon
  3. From: dillon@CORY.BERKELEY.EDU (Matt Dillon)
  4. Newsgroups: comp.sys.amiga
  5. Subject: DTERM 1.01 part 1 of 2
  6. Message-ID: <8704270431.AA06072@cory.Berkeley.EDU>
  7. Date: 27 Apr 87 04:31:12 GMT
  8. Sender: daemon@ucbvax.BERKELEY.EDU
  9. Lines: 820
  10.  
  11.  
  12. DTERM    1.01 (Beta)
  13.  
  14. BETA BETA BETA BETA BETA BETA BETA
  15. REQUEST FOR COMMENTS REQUEST FOR COMMENTS REQUEST FOR COMMENTS
  16. Specifically, what other primitives should I add to the console device
  17. to support emulation of other terminals (e.g. graphics commands?).
  18.  
  19. NOTE: Currently, there is not enough low-level support to be able to
  20. even partially emulate a VT100.  The emulation choices you have are for
  21. (A) Z29, (B) ANSI, or (C) your own devising.
  22.  
  23. For those of you who log into 4.2/3 (and many other systems), note that
  24. the termcap for a SUN is actually an extended ANSI specification,
  25. compatible with the Amiga's console driver.
  26.  
  27.     (I)    Overview of Features
  28.     (II)    Command line options
  29.     (III)    Command Language
  30.     (IV)    State Machine Commands    (including carrier state change autovectors)
  31.     (V)    Menu Commands
  32.     (VI)    Mapping Commands
  33.     (VII)    Serial Commands (including console init autovector)
  34.     (VIII)    Misc. other commands    (including XMODEM commands)
  35.  
  36.     (X)    SAMPLE S:DTERM.INIT FILE
  37.     (XI)    SAMPLE Z29 emulation init file.
  38.  
  39.  
  40.  
  41. (I) OVERVIEW OF FEATURES
  42.  
  43.     note:   SENDFILE is a command to send a raw data file over the modem
  44.     without using any protocal and without passing the data through any
  45.     maps.
  46.  
  47.     USER PROGRAMMABLE DATA TRANSLATIONS:
  48.         KeyMap        KEYMAP
  49.         DataMap     DATAMAP
  50.  
  51.     *******************************************************************
  52.  
  53.  
  54.     KEYBOARD---->KEYMAP---->SERIALOUT
  55.             |
  56.             V
  57.            [full duplex]? YES -> done
  58.             NO
  59.             | (HALF, HOST, or HMONITOR duplex)
  60.             |
  61.             |
  62.             |>------>WINDOW
  63.             |>------>CAPTURE (if capture mode)
  64.             \>------>TOCLI     (if remote on & duplex == HMONITOR)
  65.  
  66.  
  67.     SERIALIN--->DATAMAP---->WINDOW
  68.             |
  69.             |>------>WINDOW
  70.             |>------>CAPTUREFILE (if capture mode)
  71.             |>------>TOCLI         (if remote on)
  72.             |>------>STATE_MACHINE
  73.             \>------>SERIALOUT   (if HOST or HMONITOR duplex)
  74.  
  75.  
  76.  
  77.     FROMCLI---------->KEYMAP---------->SERIALOUT
  78.         |
  79.     [HMONITOR duplex]? ---> NO, stop
  80.         YES
  81.         V
  82.         |
  83.         \---->DATAMAP--------->WINDOW
  84.                 |
  85.                 \----->CAPTUREFILE  (if capture mode)
  86.  
  87.  
  88.     SENDFILE-------------------------->SERIALOUT
  89.  
  90.     DIAGNOSTICMESSAGES---------------->LOGFILE (when log is on)
  91.  
  92.   When in XMODEM protocol, everything is suspended and the following
  93.   applies.  XMODEM protocol is entered explicitly with XRECEIVE and
  94.   XTRANSMIT commands.
  95.  
  96.     XTRANSMIT<------------------------>SERIALIN/OUT    (when sending XMODEM)
  97.     XRECEIVE <------------------------>SERIALIN/OUT    (when recv. XMODEM)
  98.  
  99.  
  100.  
  101.     DTERM is a terminal program for use with an Amiga.    DTERM is not meant
  102.     for the weak and helpless.     I consider the following features:
  103.  
  104.     (1) Small executable
  105.     (2) State Machine allowing you to build any automatic control structure
  106.     you wish (from auto-redial, sequence dialing, to auto-logon).
  107.  
  108.     (3) Intelligent Data Mapping
  109.     (4) Intelligent Keyboard Mapping
  110.     (5) Dynamic Menus (user-buildable)
  111.     (6) somewhat intelligent command language (DME-like, but with
  112.     extensions, and a different set of commands of course).
  113.  
  114.     (7) Asyncronous writes in capture mode (it isn't not jerky), and
  115.     block pre-fetch/asyncronous writes in the XMODEM transfer
  116.     protocol.
  117.  
  118.     (8) duplex control, can SLAVE a CLI to the serial port.
  119.  
  120.     A consequence of (3) and (4) means that an intelligent person can
  121.     setup maps to effectively emulate most other terminals.
  122.  
  123.  
  124. (II) COMMAND LINE OPTIONS
  125.  
  126.     DTERM [-flags] [file1...filen]
  127.  
  128.     -x        -Use XON/XOFF protocol
  129.     -f        -Use RAD_BOOGIE (see serial documentation)
  130.     -7        -Use 7Wire protocol
  131.     -e        -Use Exclusive Access
  132.     -b        -Use BORDERLESS window.  Assume person's CONAI vector will
  133.          handle initializing the console device's window parameters.
  134.     default:    SHARED access, no protocol
  135.  
  136.     file1...filen:  A list of script files to execute on startup.  If no
  137.     files specified, S:DTERM.INIT is sourced.
  138.  
  139.  
  140.  
  141. (III) COMMAND LANGUAGE
  142.  
  143.     The command language is based on the DME text editor.  For those of
  144.     you familar with DME, the modifications to the basic structure are
  145.     as follows:  (read the following only if you are familar with DME!!)
  146.     ^c   = control-c, for embedding control characters in a source file
  147.     \nnn = octal escape code
  148.     \f   = a forward single quote (good for first pass-thru only)
  149.     \b   = a back single quote    (good for first pass-thru only)
  150.  
  151.     COMMAND LANGUAGE:
  152.  
  153.     A command has a certain number of arguments.  You can string any
  154.     number of commands together because DTERM knows exactly how many
  155.     arguments each command takes.  Thus:
  156.  
  157.     baud 1200 parity even bits 8 stop 1
  158.  
  159.     will set the program into 1200 baud, even parity, wordlength of 8,
  160.     and 1 stop bit.  Note that arguments are space delimited.  A problem
  161.     occurs when you want a given argument to contain several words.  You
  162.     can get around this by surrounding the argument with a
  163.     SINGLE-BACK-QUOTE, SINGLE-FORWARD-QUOTE `' pair.  Example:
  164.  
  165.     conwrite `hello this is a test' conwrite sorry
  166.  
  167.     A set of back-forward single quotes is stripped every time a string
  168.     is passed through the command interpreter.    This represents a
  169.     problem only if some command's argument(s) will be sent through the
  170.     command interpreter at some later date.  The CONAI command is a good
  171.     example.  The argument you specify to the CONAI command is executed
  172.     whenever the console gets reset, allowing you to automatically
  173.     reconfigure the console device.  Since a backquote-quote pair will
  174.     be stripped the second time through (once when you gave the CONAI
  175.     command, and once when the CONAI command's argument is executed):
  176.  
  177.     conai `conwrite `my console has been reset!' conwrite bah'
  178.  
  179.     The outer set forces CONAI to recognize the entire rest of the line
  180.     as it's single argument.  The inner set forces the CONWRITE command
  181.     to recognize the 5 words `my console has been reset!' as its
  182.     single argument when it gets executed some time in the future.
  183.  
  184.     Text sent to the modem must be enclosed by yet another backquote-quote
  185.     pair to differentiate it from a command:
  186.  
  187.     conwrite hello    -writes hello to the console device.
  188.     `conwrite hello'    -sends the string "conwrite hello" over the modem
  189.  
  190.     This can be confusing.  Here is a more complex example using CONAI:
  191.  
  192.     conai `baud 2400 `this is sent over the modem at 2400 baud''
  193.  
  194.     (not that you would want to put a serial control command in a
  195.     console reset vector... the console gets reset whenever you resize its
  196.     window.)
  197.  
  198.     USUALLY, YOU WANT TO PUT THE FOLLOWING IN S:DTERM.INIT:
  199.     conai `conwrite `^[[20l''
  200.  
  201.     Almost every terminal in existance uses LF=LF rather than
  202.     LF=CRLF, which is what the above will accomplish.
  203.  
  204.  
  205.     OVERVIEW OF COMMANDS.  See specific sections for more information.
  206.  
  207.     DUPLEX     full/half/host/hmonitor        duplex mode
  208.     BAUD     n                    Set Baud
  209.     PARITY     even/odd/mark/space/off        Set Parity
  210.     STOP     n                    Set Stop bits
  211.     BITS     n                    Set Wordlength
  212.     DELAY     mS                    Delay X mS
  213.     DD                            Delay 1/10 sec
  214.     SOURCE     file                    script
  215.     RESIZE     cols rows                resize window
  216.     SMADD     state newstate matchstring command    add state
  217.     SMREM     state.uniq                remove a specific entry
  218.     SMREMSTATE     state                    remove entire state
  219.     SMCLEAR                        remove ALL states
  220.     SMGOTO     state                    goto a state
  221.     SMONCD     command                On Carrier Detect
  222.     SMONCL     command                On Carrier Lost
  223.     SMONPUCD     command                CD on initial power up
  224.     SMLIST                        display SM info
  225.     DATAMAP     from to                map incomming data
  226.     DATAUNMAP     from                    unmap a map
  227.     DATACLEAR                        clear all datamaps
  228.     KEYMAP     from to   (NOT like DME)        map outgoing keystrokes
  229.     KEYUNMAP     from                    unmap a map
  230.     KEYCLEAR                        clear all datamaps
  231.     MENUADD     menuname itemname command        add a menu entry
  232.     MENUDEL     menuname itemname            delete a menu entry
  233.     MENUCLEARCOL menuname                clear a menu header
  234.     MENUCLEAR                        clear entire menu
  235.     CONAI     command                On Console Init
  236.     CONWRITE     string                 write to console.device
  237.     CAPON     file                    capture to file
  238.     CAPOFF                        close capture
  239.     LOGON     file                    log error/status msgs to file
  240.     LOGOFF                        no log
  241.     SEND     file                    send from file
  242.     SENDABORT                        abort send
  243.     XRECEIVE     file                    XMODEM receive
  244.     XTRANSMIT     file                    XMODEM transmit
  245.  
  246.     SLAVE     on/off                 remote CLI
  247.     SETSLAVE     command                set slave command
  248.                             default is a NEWCLI.
  249.  
  250.     COMENTRY                        manual command entry
  251.     COMPROMPT     promptstring                latter w/prompt
  252.  
  253.  
  254.  
  255. (IV)    STATE MACHINE COMMANDS
  256.  
  257.     The state machine looks at every sub-string comming over the serial
  258.     line for matches against the matchstring of all entries in the current
  259.     state.  Here is an example script to automatically set DTERM's baud
  260.     rate to a modem's new baud rate after it connects to some remote
  261.     machine:
  262.  
  263.     template:    SMADD    state newstate matchstring command
  264.  
  265.     ###########
  266.     smclear
  267.     smadd a b `CONNECT 2400^m^j'  `baud 2400 delay 2000 `^m''
  268.     smadd a b `CONNECT 1200^m^j'  `baud 1200 delay 2000 `^m''
  269.     smadd a b `CONNECT^m^j'       `baud 300 delay 2000 `^m''
  270.     smadd a b `CONNECT ^m^j'      `baud 300 delay 2000 `^m''
  271.     smgoto a
  272.     smoncl `smgoto a'
  273.     ###########
  274.  
  275.     In this case, all entries are in state 'a'.  While the state machine
  276.     is in state 'a', any of these messages will cause it to execute the
  277.     specified command and then go into state 'b'.  Note that we have
  278.     setup the automatic carrier-lost vector to go back into state 'a' on
  279.     carrier lost.
  280.  
  281.     Statenames are in ascii, and need not be a single character.  When you
  282.     remove a state with SMREMSTATE, you are removing all the entries in
  283.     that state.
  284.  
  285.     The state machine is bypassed whenever it is placed in a state which
  286.     doesn't exist... `SMGOTO idontexist'
  287.  
  288.     SMADD     state[.uniq] newstate matchstring command
  289.                             add state
  290.     SMREM     state.uniq                remove an entry
  291.     SMREMSTATE     state                    remove entire state
  292.     SMGOTO     state                    goto a state
  293.     SMONCD     command                On Carrier Detect
  294.     SMONCL     command                On Carrier Lost
  295.     SMONPUCD     command                CD on power up.
  296.     SMCLEAR                        Remove ALL states
  297.     SMLIST                        display SM info
  298.  
  299.     Note: SMONPUCD means 'if the carrier is active when this modem program
  300.     starts up'.  Usually this means that you exited the modem program then
  301.     re-ran it, and that you are already logged into the machine.  You can
  302.     thus have the command be, say, an SMGOTO to your 'online' state.
  303.  
  304.     HINTS:  You could, of course, put all your matches into a single state,
  305.     but this could be disastorous if any of those strings occured
  306.     accidently while you were connected to some host.  Thus, you should
  307.     breakup the state-sets logically.
  308.  
  309.     Definition of state-set:   A state-set is a single state containing
  310.     several match->command entries.  E.G. The example above has a single
  311.     state-set named 'a' with 4 entries.
  312.  
  313.     -Have a state-set that you SMONCL to (SMONCL `smgoto state') for
  314.      your 'off line' activity... e.g. dialing, re-dialing, etc...
  315.  
  316.     -Have a base state-set for your 'connected but not yet logged in'
  317.      state which then dispatches to other state-sets when it determines
  318.      what your logging in to.
  319.  
  320.     -Once you are completely logged in, place the state machine in
  321.      a non-existant or minimal state to prevent accidental matches
  322.      from occuring and to make DTERM run faster (though the slowdown
  323.      is not noticeable at 2400 baud!).
  324.  
  325.     The state commands are usually placed in the S:DTERM.INIT file.
  326.  
  327.     IDENTIFYING STATES FOR REMOVAL WITH SMREM.    You can identify an
  328.     entry in a state by giving it a unique name  state[.name]. example:
  329.  
  330.     smadd a        b match1 command1
  331.     smadd a.special b match2 command2
  332.  
  333.     smrem a.special        -remove a.special only.
  334.  
  335.     NOTE:  Both `a' and `a.special' are considered in state `a'.  The
  336.     .special is only a way of identifying an entry so you can remove it
  337.     later.
  338.  
  339.  
  340.  
  341. (V) MENU COMMANDS
  342.  
  343.     The Menu commands allow you to build user-defined menu's.  These are
  344.     usually placed in S:DTERM.INIT also.  You should make a menu entry
  345.     for the COMENTRY command always to allow you to get into
  346.     manual command-entry mode.    Here is an example:
  347.  
  348.     menuadd phone cory        ``^j' dd `^matdt6420074^m''
  349.     menuadd phone cogsci    ``^j' dd `^matdt6420713^m''
  350.     menuadd phone portsel   ``^j' dd `^matdt6436545^m''
  351.     menuadd phone fidonet   ``^j' dd `^matdt6599169^m''
  352.     menuadd phone bbs2        ``^j' dd `^matdt5952479^m''
  353.     menuadd phone wincrc    ``^j' dd `^matdt8454812^m''
  354.     menuadd phone amwest    ``^j' dd `^matdt3557162^m''
  355.     menuadd phone amconn    ``^j' dd `^matdt5627097^m''
  356.     menuadd phone bbsJC     ``^j' dd `^matdt9617250^m''
  357.     menuadd ctl   comentry  `comentry'
  358.     menuadd ctl   7bit-even `bits 7 parity even'
  359.     menuadd ctl   8bit-none `bits 8 parity off'
  360.     menuadd window 80x24    `resize 80 24'
  361.     menuadd window 80x25    `resize 80 25'
  362.     menuadd emulate none    `dataclear keyclear'
  363.     menuadd emulate z29     `source emulate:z29.termcap'
  364.     menuadd emulate vt100   `source emulate:vt100.termcap'
  365.  
  366.  
  367.  
  368. (VI) MAPPING COMMANDS
  369.  
  370.     Arbitrary keyboard and data mapping is accomplished with the
  371.     DATAMAP and KEYMAP commands.  Both have the same syntax with the
  372.     exception that one applies to the mapping of incomming data, and
  373.     the other applies to the mapping of keys.
  374.  
  375.     XXXMAP    from    to
  376.  
  377.     DTERM's terminal window IS the Amiga's console device with some 
  378.     additional features:
  379.  
  380.     \200    Insert Mode OFF            0x80
  381.     \201    Insert Mode ON            0x81
  382.     \202    Save Cursor Position        0x82
  383.     \203    Restore Cursor Position        0x83
  384.     \204    Back Tab            0x84
  385.  
  386.     The easiest mapping to understand is an ascii-to-ascii map:
  387.     (map esc-A to esc-left_bracket-A)
  388.  
  389.     DATAMAP  ^[A    ^[[A
  390.  
  391.     The control sequence introducer on the FROM string is '$'.  Thus,
  392.     to get a '$' as part of the from string, you need to say '$$'.
  393.     $c stands for an arbitrary character, and $d stands for an arbitrary
  394.     ascii-numeric string.  When the actual map occurs, both are converted
  395.     to numbers and placed into an array for further manipulation by the
  396.     TO string.
  397.  
  398.     FROM STRING CONTROL SPECIFIERS:
  399.         $c    arbitrary character
  400.         $d    arbitrary ascii-numeric str.
  401.  
  402.     TO STRING CONTROL SPECIFIERS:
  403.         $N[+/-OFFSET]c
  404.         $N[+/-OFFSET]d
  405.  
  406.     The TO control specifier is a bit more complex.  You pick an array
  407.     entry with $N (starting at 0), add an optional offset value to it,
  408.     then plot it down as either a single character, or an ascii-decimal
  409.     string.  Example:
  410.  
  411.     (Convert Z29 cursor move sequence to ANSI cursor move sequence)
  412.     datamap ^[Y$c$c ^[[$0-31d;$1-31dH
  413.               ^[Y8!   -> ^[[25;2H
  414.  
  415.     (Map escape X c1 c2 to d2 d1)
  416.     datamap ^[X$c$c $1d.$0d
  417.               ^[XAB   -> 66.65
  418.  
  419.     datamap ^[X$c $0-10d
  420.               ^[XA    -> 55
  421.     datamap ^[X$c $0+10d
  422.               ^[XA    -> 75
  423.     datamap ^[X$c $0+1c
  424.               ^[XA    -> B
  425.  
  426.     See the provided emulation files (not quite complete working, but
  427.     pretty close) for more examples.
  428.  
  429.  
  430.     WITHHOLDING DELAYS:     If you do a keymap, say ^[X -> hello,  and
  431.     then type ESC, you will note that nothing got sent over the modem.
  432.     DTERM withholds anything left unresolved until it is either resolved,
  433.     or found not to be mapped.    Thus:
  434.  
  435.     ESC   (nothing sent)  X   (hello sent)
  436.     ESC   (nothing sent)  Y   (ESC Y sent)
  437.  
  438.     MAPS OVERRIDING OTHER MAPS:     Later maps can override earlier
  439.     ones.  Thus, if you have two maps:
  440.  
  441.     KEYMAP    ^[a    haha
  442.     KEYMAP    ^[$c    bobo
  443.  
  444.     The ^[$c map will ALWAYS be executed, even if you type ^[a.  Rightly,
  445.     you should have the order reversed:
  446.  
  447.     KEYMAP    ^[$c    bobo
  448.     KEYMAP    ^[a    haha
  449.  
  450.     Thus you can MAP something general (using $c) to nothing, and then MAP
  451.     some exceptions to the rule.
  452.  
  453.  
  454. (VII)    SERIAL COMMANDS
  455.  
  456.     BAUD, PARITY, STOP, BITS.  Examples:
  457.  
  458.     BAUD 2400 PARITY off BITS 8 STOP 1
  459.  
  460.     NOTE: if using the -f flag (RAD_BOOGIE), the serial device makes some
  461.     assumptions on the parity and wordsize.  Read the serial.device docs
  462.     for more information.
  463.  
  464.  
  465. (VIII)    MISC OTHER COMMANDS
  466.  
  467.     The remaining commands are:
  468.  
  469.     DD
  470.         Delay for a 1/10 of a second.
  471.  
  472.     DELAY N
  473.         Delay for N milliseconds.    `DD 1000' will delay for a second
  474.  
  475.     SOURCE file
  476.         Source a script file.  The script file usually contains state
  477.         machine entries, menu additions, terminal emulation mappings,
  478.         etc...
  479.  
  480.         SOURCE s:dterm.init
  481.  
  482.     RESIZE cols rows
  483.  
  484.         Attempt to resize the window on the current screen.  No window
  485.         repositioning is done.  You might have to move the window to
  486.         the upper-left hand corner before resizing depending.  If the
  487.         screen is big enough, a bordered window is used.  If the screen
  488.         is barely big enough, a borderless window is used.    If the
  489.         screen isn't big enough for even a borderless window, you get
  490.         an error message.
  491.  
  492.         RESIZE 80 24
  493.         RESIZE 76 24
  494.  
  495.         Your CONAI command is automatically executed after the window
  496.         is resized.
  497.  
  498.  
  499.     CONAI command
  500.  
  501.         The command is executed immediate, and also whenever the console
  502.         device gets reset.    This occurs whenever a window is resized.
  503.         Usually, CONAI is set to:
  504.  
  505.         conai `conwrite `^[[20l''
  506.  
  507.  
  508.     CONWRITE string
  509.  
  510.         Write a string directly to the console device.  Does not go
  511.         through the serial.device.    Usually used to initialize the
  512.         console.
  513.  
  514.     CAPON   file
  515.  
  516.         Begin capture mode to a file.  If the file already exists, it
  517.         is APPENDED to.
  518.  
  519.     CAPOFF
  520.  
  521.         End capture mode to a file
  522.  
  523.     DUPLEX HALF/FULL/HOST/HMON
  524.  
  525.         -FULL:  (DEFAULT) keystrokes are not normally displayed on
  526.             terminal screen after going through the keymap.
  527.  
  528.         -HALF:  keystrokes in terminal window are echo'd on terminal
  529.             screen after going through the keymap.
  530.  
  531.         -HOST:  keystrokes are echo'd on terminal screen after going
  532.             through keymap.  Additionally, any data comming over
  533.             the serial port is echo'd back to the sender as well
  534.             as displayed.
  535.  
  536.         -HMON:  same as HOST mode, but if SLAVE is on (for SLAVED CLI),
  537.             keystrokes from the terminal window are also sent to
  538.             the CLI.
  539.  
  540.     LOGON   file
  541.  
  542.         Log messages to a file.. appends to the file.  Anything that
  543.         is displayed on your console by DTERM (not incomming serial
  544.         data) is logged.
  545.  
  546.     LOGOFF
  547.  
  548.         Stop logging messages
  549.  
  550.     SEND file
  551.  
  552.         Send a file over the modem by simply COPYing it to the serial
  553.         device.
  554.  
  555.     SENDABORT
  556.  
  557.         Abort a Send (Sends are done semi-asyncronously).
  558.  
  559.     XRECEIVE file
  560.  
  561.         XMODEM protocol receive to file.  Basic XMODEM protocol using
  562.         a checksum.  The file is written to asyncronously and thus you
  563.         need not specify the RAM: disk for optimal performance.
  564.  
  565.         If the file previously exists, XRECEIVE will attempt to find
  566.         a function of that filename which does not exist. (e.g. file0,
  567.         file1, file2...).  This allows automated downloading.
  568.  
  569.     XTRANSMIT file
  570.  
  571.         XMODEM protocol send from a file.  Basic XMODEM protocol using
  572.         a checkdsum.  The file blocks are pre-fetched while the
  573.         previous block is being sent asyncronously, and thus you need
  574.         not copy the file to the RAM: disk before sending.
  575.  
  576.     COMENTRY
  577.  
  578.         Begin manual command entry.  Hit return on a blank line to
  579.         end manual entry of commands.
  580.  
  581.     COMPROMPT arg
  582.  
  583.         Enter COMENTRY mode with 'arg' already typed for you... allows
  584.         making menu options which prompt for thing.
  585.  
  586.     SETSLAVE executecommand
  587.  
  588.         Set the command which is Execute()d when SLAVE mode is turned
  589.         on.  The default is 'NEWCLI'.
  590.  
  591.         The command will be executed with a single argument which will
  592.         be the file it is supposed to do ALL communication with the
  593.         modem program through.  The Execute() is expected to return
  594.         immediately, so you should specify something like:
  595.  
  596.         SETSLAVE `run myslave'
  597.  
  598.         The slave program MUST open the specified file with modes
  599.         1005.  The slave program does it's READs and WRITEs to the
  600.         SAME FILE HANDLE.  The latest version of my PIPE: program must
  601.         be mounted in your system for this to work.
  602.  
  603.         NOTE:  The filename passed to your slave program looks something
  604.         like this:
  605.  
  606.         PIPE:somename/t
  607.  
  608.         Usually, you'll want to append a signal to this (make it
  609.         /ts#, for instance, where # is a signal number you have
  610.         allocated) to give you more control.  READ THE DOCS FOR A
  611.         PIPE TO UNDERSTAND THE MEANING!
  612.  
  613.         Look at the flow diagrams at the beginning to see how data
  614.         flows to and from the slave program.
  615.  
  616.         IT IS NOT RECOMMENDED THAT YOU IMPLEMENT TRANSFER PROTOCOLS
  617.         WITH SLAVE PROGRAMS.  This is because the data would have to
  618.         travel through two processes before ever going out the serial
  619.         port, causing unforgivable delays in a transfer protocol.
  620.  
  621.         The slaving is still in a very experimental state.
  622.  
  623.     SLAVE on/off
  624.  
  625.         ACTIVATE SLAVE CLI.  my latest PIPE: device must be mounted
  626.         for this to work.  NOTE: When you turn SLAVE off, the CLI
  627.         will still be connected to the PIPE.  To disconnect the CLI
  628.         from the pipe, you must send an ENDCLI to the CLI.
  629.  
  630.         This command starts up a new CLI on the pipe if none currently
  631.         is attached.
  632.  
  633.         -EFFECTS:    Any data received from the serial port is sent to
  634.         the CLI after going through the datamap.  Any data output from
  635.         the CLI is sent to the serial port after going through the
  636.         keymap.
  637.  
  638.  
  639. (X) SAMPLE S:DTERM.INIT FILE.
  640.  
  641.     This is the DTERM.INIT file that I use.  Needless to say, I've changed
  642.     all references to specific machine names, user names, and passwords to
  643.     gobbly gook.
  644.  
  645. #######################################################################
  646. # Hash is a comments introducer, and must be the first character on   #
  647. # a line                                  #
  648. #                                      #
  649. #                DTERM.INIT                      #
  650. #                                      #
  651. #######################################################################
  652. baud 2400 parity even bits 7
  653. smclear
  654. smadd a a `comp1'           `baud 2400 parity even bits 7 `^j^matdt5551111^m''
  655. smadd a a `comp2'           `baud 2400 parity even bits 7 `^j^matdt5552222^m''
  656. # NOTE: Sends a return 2 seconds after connect.
  657. smadd a a `CONNECT 2400^m^j'  `baud 2400 delay 2000 `^m''
  658. smadd a a `CONNECT 1200^m^j'  `baud 1200 delay 2000 `^m''
  659. smadd a a `CONNECT^m^j'       `baud 300 delay 2000 `^m''
  660. smadd a a `CONNECT ^m^j'      `baud 300 delay 2000 `^m''
  661.  
  662. # Handle a port-selector
  663. smadd b b    Request:        `dd `cory^m''
  664. # Figure out which computer it is by it's header message
  665. smadd b cl    comp1            `'
  666. smadd b cg    comp2            `'
  667. # A BBS!
  668. smadd b cbbs    `name:'             ``Matthew Dillon^m''
  669.  
  670. smadd cbbs cbbs `Password:'         `delay 1000 `mypassword^m''
  671. smadd cbbs cbbs `[Y,n]:'            `delay 1000 `^m''
  672.  
  673. smadd cl cl1    login:            `dd `dillon^m''
  674. smadd cl1 cl1    Password:        `dd `mypassword^m''
  675. smadd cl1 cl    incorrect        `'
  676. smadd cl1 online (z29)            `dd `vt100^m''
  677.  
  678. smadd cg cg1    login:            `delay 2000 `myfriend^m''
  679. smadd cg1 cg1    Password:        `dd dd dd dd `hispassword' dd `^m''
  680. smadd cg1 cg    incorrect        `'
  681. # For UNIX systems, TERM = sun    (Latest ANSI with enhancements)
  682. # Compatible with the Amiga's CONSOLE.DEVICE
  683. # My login defaults to a Z29...
  684. smadd cg1 online (z29)             `dd `sun^m''
  685.  
  686. #smadd online online Password:         ``mypassword^m''
  687.  
  688. smgoto a
  689. smoncl `smgoto a delay 1000 baud 2400'
  690. smoncd `smgoto b'
  691. smonpucd `smgoto online'
  692.  
  693. menuadd phone fidonet    ``^j' dd `^matdt6599169^m''
  694. menuadd phone bbs2    ``^j' dd `^matdt5952479^m''
  695. menuadd phone wincrc    ``^j' dd `^matdt8454812^m''
  696. menuadd phone amwest    ``^j' dd `^matdt3557162^m''
  697. menuadd phone amconn    ``^j' dd `^matdt5627097^m''
  698. menuadd phone bbsJC    ``^j' dd `^matdt9617250^m''
  699. menuadd ctl   comentry    `comentry'
  700. menuadd ctl   7bit-even `bits 7 parity even'
  701. menuadd ctl   8bit-none `bits 8 parity off'
  702. menuadd ctl   `redial on'   `smadd a a `BUSY^m^j' `delay 30000 `a/'''
  703. menuadd window 80x24    `resize 80 24'
  704. menuadd window 80x25    `resize 80 25'
  705. menuadd emulate none    `dataclear keyclear'
  706. menuadd emulate z29    `source emulate:z29.termcap'
  707.  
  708. conai `conwrite `^[[20l''
  709. #######################################################################
  710. #                                      #
  711. #        END DTERM.INIT                          #
  712. #                                      #
  713. #######################################################################
  714.  
  715.  
  716.  
  717.  
  718. (XI) SAMPLE Z29 EMULATION INIT FILE (not complete, but it gives you the idea).
  719.  
  720. ######################################################################
  721. #            EMULATE:Z29.TERMCAP                 #
  722. #   NOTE: assumes your terminal window is 25-lines             #
  723. ######################################################################
  724. # Z29 termcap
  725. # :am            has automatic margins
  726. # :bc=\ED        backspace if not ^H
  727. datamap ^[D    \233D
  728. # :bt=\E-        backtab
  729. datamap ^[-    \204
  730. # :do=^J        down one line
  731. # :al=\EL        add new blank line
  732. datamap ^[L    \233L
  733. # :le=^H        cursor left
  734. # :bs            terminal can BS with ^H
  735. # :cd=\EJ        clear to end of display
  736. datamap ^[J    \233J
  737. # :ce=\EK        clear to end of line
  738. datamap ^[K    \233K
  739. # :cl=\EE        clear screen and home
  740. datamap ^[E    \2331;1H\233J
  741. # :cm=\EY%+\040%+\040    cursor move
  742. datamap ^[Y$c$c \233$0-31d;$1-31dH
  743. datamap ^[Y8$c    \23325t\23325;$0-31dH
  744. # :co#80        #cols
  745. # :dc=\EN        delete char
  746. datamap ^[N    \233P
  747. # :dl=1*\EM        delete line
  748. datamap ^[M    \233M
  749. # :ei=\EO        end insert mode
  750. datamap ^[O    \200
  751. # :ho=\EH        home cursor
  752. datamap ^[H    \233H
  753. # :im=\E@        enter insert mode
  754. datamap ^[@    \201
  755. # :li#24        #lines
  756. # :mi            safe to move while in insert mode
  757. # :nd=\EC        cursor right
  758. datamap ^[C    \233C
  759. # :as=\EF        start alternate char set
  760. datamap ^[F    `'
  761. # :ae=\EG        end alternate char set
  762. datamap ^[G    `'
  763. # :ms            safe to move in standout mode
  764. # :pt            has hardware tabs
  765. # :sr=\EI        scroll text down
  766. datamap ^[I    \233T
  767. # :se=\Eq        end standout mode
  768. datamap ^[q    `'
  769. # :so=\Ep        begin standout mode
  770. datamap ^[p    `'
  771. # :up=\EA        cursor up
  772. datamap ^[A    \233A
  773. datamap ^[B    \233B
  774. # :vs=\Ex4        cursor very visible
  775. datamap ^[x4    `'
  776. # :ve=\Ey4        cursor normal
  777. datamap ^[y4    `'
  778. # :kb=^H        sent by backspace key
  779. # :ku=\EA        up key
  780. keymap    \233A    ^[A
  781. # :kd=\EB        down key
  782. keymap    \233B    ^[B
  783. # :kl=\ED        left key
  784. keymap    \233D    ^[D
  785. # :kr=\EC        right key
  786. keymap    \233C    ^[C
  787. # :kh=\EH        home key
  788. # :kn#1 # function keys
  789. # :k0=\E~        Function key 0
  790. keymap    \2330~    ^[~
  791. # :l0=HOME        labels on function keys
  792. # :k1=\ES        function keys
  793. keymap    \2331~    ^[S
  794. # :k2=\ET
  795. keymap    \2332~    ^[T
  796. # :k3=\EU
  797. keymap    \2333~    ^[U
  798. # :k4=\EV
  799. keymap    \2334~    ^[V
  800. # :k5=\EW
  801. keymap    \2335~    ^[W
  802. # :k6=\EP
  803. keymap    \2336~    ^[P
  804. # :k7=\EQ
  805. keymap    \2337~    ^[Q
  806. # :k8=\ER
  807. keymap    \2338~    ^[R
  808. # :k9=\E0I
  809. keymap    \2339~    ^[0I
  810. # :es            escape allowed on status line
  811. # :hs            has extra 'status' line
  812. # :ts=\Ej\Ex5\Ex1\EY8%+\040\Eo        GO status line col N
  813. datamap ^[j    \202
  814. datamap ^[x1    `'
  815. datamap ^[x5    \23325t
  816. datamap ^[o    `'
  817. # :fs=\Ek\Ey5        return from status line
  818. # **big hack
  819. datamap ^[k    \203\23324t
  820. datamap ^[y5    \23324t
  821. # :ds=\Ey1        disable status line
  822. datamap ^[y1    \23324t
  823. # :us=\Es8        start underscore mode
  824. datamap ^[s8    `'
  825. # :ue=\Es0        end underscore mode
  826. datamap ^[s0    `'
  827.  
  828. #
  829. #   END EMULATE:Z29.TERMCAP
  830. #
  831.  
  832.  
  833.